package com.itheima.actuator;

import org.springframework.boot.actuate.info.Info;
import org.springframework.boot.actuate.info.InfoContributor;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * ClassName: InfoConfig
 * Description:
 * Date: 2023/03/21 PM 11:52:52
 * <p>
 * project: springboot
 * package: com.itheima.actuator
 * email: 1085844536@qq.com
 * version:
 *
 * @author WangGuojian
 */
@Component
public class InfoConfig implements InfoContributor {
    @Override
    public void contribute(Info.Builder builder) {
        builder.withDetail("runTime", System.currentTimeMillis());
        Map<String, Object> infoMap = new HashMap<>(16);
        infoMap.put("buildTime", "2006");
        builder.withDetails(infoMap);
    }
}
